package com.lc202406;

public class Solution2710 {
    public String removeTrailingZeros(String num) {
        int length = num.length();
        int index = 0;
        for (int i = length - 1; i >= 0; i--) {
            if (num.charAt(i) != '0') {
                index = i + 1;
                break;
            }
        }
        return num.substring(0, index);
    }
}
